<?php
/**
 * Created by PhpStorm.
 * User: sosyuki
 * Date: 2018/3/19
 * Time: 18:38
 */

namespace Drupal\wx_pay\Entity;


use Entity;

class WxPayTransaction extends Entity {

  //实体信息
  public $id;

  public $uid;

  public $module;

  public $attach;

  //帐号信息
  public $appid;

  public $mch_id;

  public $openid;


  //订单金额信息
  public $total_fee;

  public $out_trade_no;

  public $prepay_id;

  public $trade_type;

  public $device_info;

  public $time_end;

  public $transaction_id;

  //其它信息
  public $status;

  public $created;

  public function __construct($values = []) {
    parent::__construct($values, 'wx_pay_transaction');
  }

  public function label() {
    return "交易单号:" . $this->out_trade_no;
  }


  function save() {
    $this->created = REQUEST_TIME;
    return parent::save();
  }

}
